TARGET = lidarPlanning

PATH := ${PATH}:../../arm-linux-gnueabi/bin
CC = arm-linux-gnueabi-g++
# CC = g++
CCFLAGS = -g -std=c++11
EIGEN_INCLUDE = -I../../arm_eigen/install/include
INDOR_INCLUDE = -Iinclude/hector_slam_lib -Iinclude/lidar -Iinclude/remote -Isrc/SLAM -Iinclude/searcher -Iinclude
O_PATH = obj

LIDAR_PATH=src/lidar
SLAM_PATH=src/SLAM
REMOTE_PATH=src/remote
SEARCHAR_PATH=src/searcher

$(shell mkdir -p $(O_PATH))

LIDAR_SRC=$(wildcard $(LIDAR_PATH)/*.cpp)
LIDAR_OBJ=$(patsubst %.cpp,$(O_PATH)/%.o,$(notdir $(LIDAR_SRC)))
SLAM_SRC=$(wildcard $(SLAM_PATH)/*.cpp)
SLAM_OBJ=$(patsubst %.cpp,$(O_PATH)/%.o,$(notdir $(SLAM_SRC)))
REMOTE_SRC=$(wildcard $(REMOTE_PATH)/*.cpp)
REMOTE_OBJ=$(patsubst %.cpp,$(O_PATH)/%.o,$(notdir $(REMOTE_SRC)))
SEARCHAR_SRC=$(wildcard $(SEARCHAR_PATH)/*.cpp)
SEARCHAR_OBJ=$(patsubst %.cpp,$(O_PATH)/%.o,$(notdir $(SEARCHAR_SRC)))

INCLUDE_ARG=$(subst %, -I%,$(INDOR_INCLUDE))

all:$(TARGET)
$(TARGET): $(LIDAR_SRC) $(SLAM_SRC) $(REMOTE_SRC) ${SEARCHAR_SRC}
	$(CC) -g $^ $(EIGEN_INCLUDE) $(INDOR_INCLUDE) -lpthread -o $@

# $(SLAM_OBJ): $(SLAM_SRC)
# 	$(CC) $(CCFLAGS) -c $< $(EIGEN_INCLUDE) $(INDOR_INCLUDE) -lpthread -o $@

# $(LIDAR_OBJ): $(LIDAR_SRC)
# 	$(CC) $(CCFLAGS) -c $< $(EIGEN_INCLUDE) $(INDOR_INCLUDE) -lpthread -o $@
# .PHONY : clear

clear:
	rm -f $(TARGET)
